package by.siarhei.java.tij.reusing.exercises.ex13;

/**
 * @author Siarhei Shchahratsou <s.siarhei@gmail.com>
 * @since 16.03.14
 */
public class Overloading {
    public static void main(String[] args) {
        Derived d = new Derived();
        d.print(true);
        d.print(.0);
        d.print(.0f);
        d.print(0);
        d.print("str");
    }
}

class Base {
    void print(String str) {
        System.out.println("print(java.lang.String): " + str);
    }

    void print(int i) {
        System.out.println("print(int): " + i);
    }

    void print(float f) {
        System.out.println("print(float): " + f);
    }
}

class Derived extends Base {
    void print(double d) {
        System.out.println("print(double): " + d);
    }

    void print(boolean b) {
        System.out.println("print(boolean): " + b);
    }
}